Conversation
…eaningful differences between parsed and original files
stevearc
left a comment
There was a problem hiding this comment.
I wrote this script when I thought it was possible to ensure that godot_parser always outputs data in the same format as Godot itself. If that's not possible, then I think I would prefer a different approach entirely instead of trying to hack the formats into closer similarity.
It's not as robust of a test, but we could do something like:
a = load(file)
a_str = a.serialize()
b = load(a_str)
assert(a_str == b.serialize()
It is not impossible to do so, but different Godot versions output files differently. This becomes specially weird since, when updating a Godot project to a newer version, it doesn't save all resources again, so in a single project you might end up with files stored in different versions The script itself was very useful for me, but I understand why you'd prefer not to sanitize the diff too much. I've been doing some deeper research on how Godot stores its resources across multiple different versions and I think it will be possible to make this check with much less invasive changes to the generated files |
|
Closing in favor of #22 |
test_parse_files.py now using difflib and attempting to supress non-meaningful differences between parsed and original files
--verboseand-vto enable printing each tested file path--alloption to test all files even if one fails--unescapeto attempt to unescape all strings in the input and parsed output (see String output matching Godot 4.6 behavior #20)